//
//  VisitorLoginView.swift
//  xinlangweibo
//
//  Created by mac on 16/3/8.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit
import SnapKit
class VisitorLoginView: UIView {
//要自定义视图 首先找到入口
    override init(frame:CGRect) {
        super.init(frame:frame)
//        访问视图的自定义
        setUpUI()
        
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
//    MARK:自定义访客视图
    private func setUpUI(){
        addSubview(circleIcon)
        addSubview(largeHouse)
//        布局 需要相对于一个已经约束好的视图来添加链式布局（以下应该是第三方框架）
        circleIcon.snp_makeConstraints{
            (make) -> Void in
            make.centerX.equalTo(self.snp_centerX)
            make.centerY.equalTo(self.snp_centerY).offset(-80)
        }
        largeHouse.snp_makeConstraints{
            (make) -> Void in
        make .center.equalTo(circleIcon.snp_center)
        }
    }
//    懒加载子视图
    private lazy var circleIcon: UIImageView = UIImageView(image: UIImage(named: "visitordiscover_feed_image_smallicon"))
//    大房子
     private lazy var largeHouse: UIImageView = UIImageView(image: UIImage(named: "visitordiscover_feed_image_house"))
    private lazy var tipLable: UILabel = {
 let l = UILabel()
        l.text = "关注一些人，回到这里看看有什么惊喜"
        l.textColor = UIColor.darkGrayColor()
        l.font = UIFont.systemFontOfSize(14)
        l.sizeToFit()
        return l
}()
//    登录和注册
    private lazy var loginBtn: UIButton = {
        let btn = UIButton()
//        这是背景图片
        btn.setBackgroundImage(UIImage(named: "common_button_white_disable"), forState: .Normal)
        btn.setTitle("登录", forState: .Normal)
        btn.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        btn.titleLabel?.font = UIFont.systemFontOfSize(14)
        btn.sizeToFit()
        return btn
        
}()

    private lazy var registerBtn :UIButton = {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: "common_button_white_disable"), forState: .Normal)
        btn.setTitle("注册", forState:.Normal)
        btn.setTitleColor(UIColor.darkGrayColor(), forState:.Normal)
        btn.titleLabel?.font = UIFont.systemFontOfSize(14)
        btn.sizeToFit()
        return btn
}()
}